package com.example.yucheng.mapper;

import com.example.yucheng.domain.ReceivingPrice;
import com.example.yucheng.domain.ReceivingUnit;
import com.example.yucheng.util.PageQuery;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ReceivingUnitMapper {


    @Select("select * from receiving_unit order by id desc")
    public List<ReceivingUnit> getReceivingList();

    @Select("SELECT * FROM receiving_unit order by id desc limit #{pageNum},#{pageSize}")
    public List<ReceivingUnit> getReceivingListByLimit(PageQuery pageQuery);

    @Delete("DELETE FROM  receiving_unit WHERE id = #{id}")
    public boolean deleteReceivingPrice(@Param("id") int id);

    @Update("UPDATE receiving_unit SET remark = #{remark},name = #{name},person=#{person},phone=#{phone},address=#{address} WHERE id = #{id}")
    public boolean updateReceivingPrice(ReceivingUnit receiving);

    @Insert("INSERT INTO receiving_unit (name,person,phone,address,remark) VALUES( #{name},#{person},#{phone},#{address},#{remark})")
    public boolean insertReceivingPrice(ReceivingUnit receiving);


}
